package org.intellij.doctree.node;

import java.io.Serializable;

public class DocumentNode extends DocTreeNode implements Serializable {

    public DocumentNode(String url, String name, String description) {
        super(new Document(url, name, description));
        setAllowsChildren(false);
    }

    public DocumentNode(String url, String name) {
        this(url, name, null);
    }

    public DocumentNode(Document document) {
        super(document);
        setAllowsChildren(false);
    }

    public Document getDocument() {
        return ((Document) userObject);
    }

    public void setDocument(Document document) {
        setUserObject(document);
    }

    public String getName() {
        Document d = getDocument();
        if (d == null) return null;
        return d.getName();
    }

    public String getURL() {
        Document d = getDocument();
        if (d == null) return null;
        return d.getURL();
    }

    public String getDescription() {
        Document d = getDocument();
        if (d == null) return null;
        return d.getDescription();
    }

}
